Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional "Heap ballast" to alter GC behaviour. #1489

Merged
merged 1 commit into from
Jul 3, 2019
Merged

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented Jul 2, 2019

This is a terrible, terrible thing. I apologise.

It allows the heap size to be made bigger, to make Go's GC run less often and use less CPU. See golang/go#23044
Particularly aimed at distributors.

This allows the heap size to be made bigger, to make Go's GC run less
often and use less CPU.  See golang/go#23044

Signed-off-by: Bryan Boreham <bryan@weave.works>
Copy link
Contributor

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. It's awful and will likely really help with tail latency as well (if I remember the uber article correctly at least).

@@ -60,6 +66,7 @@ func main() {
level.Error(util.Logger).Log("msg", "error running Cortex", "err", err)
}

runtime.KeepAlive(ballast)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! I tried doing this in a different project awhile ago and did not know about KeepAlive.

@bboreham bboreham merged commit 561033f into master Jul 3, 2019
@bboreham bboreham deleted the ballast branch July 3, 2019 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants